<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<%@ include file="/commons/kindeditor.jsp" %>
<script type="text/javascript">
    $(function() {
    	//初始化类目选择和图片上传器
		TAOTAO.init({fun:function(node){}});
        $('#countryEditForm').form({
            url : '${path}/admin/country/edit',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div style="padding:10px 10px 10px 10px">
        <form id="countryEditForm" method="post" enctype="multipart/form-data">
            <table class="grid">
				<input   id="id" name="id" type="hidden" value="${country.id}" />
                <tr>
                    <td>中文全称</td>
					<td>
						<input   id="cname" name="cname" type="text" placeholder="请输入中文全称" class=" easyui-textbox" data-options="required:false"  value="${country.cname}" />
					</td>
                    <td>中文简称</td>
					<td>
						<input   id="caname" name="caname" type="text" placeholder="请输入中文简称" class=" easyui-textbox" data-options="required:true"  value="${country.caname}" />
					</td>
				</tr>
                <tr>
                    <td>英文全称</td>
					<td>
						<input   id="ename" name="ename" type="text" placeholder="请输入英文全称" class=" easyui-textbox" data-options="required:false"  value="${country.ename}" />
					</td>
                    <td>英文简称</td>
					<td>
						<input   id="eaname" name="eaname" type="text" placeholder="请输入英文简称" class=" easyui-textbox" data-options="required:false"  value="${country.eaname}" />
					</td>
				</tr>
                <tr>
                    <td>缩写</td>
					<td>
						<input   id="abbreviation" name="abbreviation" type="text" placeholder="请输入英文简称" class=" easyui-textbox" data-options="required:false"  value="${country.abbreviation}" />
					</td>
					<td>所属分类</td>
					<td>
						<select id="type" name="type" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
							${dic:getBusDictListToOption('COUNTRY_TYPE')}
						</select>
						<script type="text/javascript">
                            //下拉框赋值
                            $("#type").val('${country.type}');
						</script>
					</td>
				</tr>
                <tr>
                    <td>国旗图片</td>
					<td><a href="javascript:void(0)" class="easyui-linkbutton onePicUpload">上传图片</a>
						<input  type="hidden" name="imgUrl" id="imgUrl" value="${country.imgUrl}" class="img_url"/>
						<script type="text/javascript">
						$(function(){
							var imageUrls='${country.imgUrl}';
							var imgs=imageUrls.split(",");
							var hl="";
							for (var i=0;i<imgs.length;i++)
							{
								hl+="<a href="+imgs[i]+" target='_blank'><img src='"+imgs[i]+"' width='90'/></a>"
							}
							$("#imgUrl_imgs").html(hl);
						});
						</script>
						<span id="imgUrl_imgs"></span>
					</td>
					<td>图标</td>
					<td><a href="javascript:void(0)" class="easyui-linkbutton onePicUpload">上传图片</a>
						<input  type="hidden" name="iocUrl" id="iocUrl" value="${country.iocUrl}" class="img_url"/>
						<script type="text/javascript">
                            $(function(){
                                var imageUrls='${country.iocUrl}';
                                var imgs=imageUrls.split(",");
                                var hl="";
                                for (var i=0;i<imgs.length;i++)
                                {
                                    hl+="<a href="+imgs[i]+" target='_blank'><img src='"+imgs[i]+"' width='90'/></a>"
                                }
                                $("#iocUrl_imgs").html(hl);
                            });
						</script>
						<span id="iocUrl_imgs"></span>
					</td>
				</tr>
				<%--／＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝--%>
				<tr>
					<td>首都:</td>
					<td>
						<input id="capital" name="capital" type="text" placeholder="请输入首都" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.capital}" />
					</td>
					<td>首都英文:</td>
					<td>
						<input id="capitalEn" name="capitalEn" type="text" placeholder="请输入首都英文" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.capitalEn}" />
					</td>
				</tr>
				<tr>
					<td>官方语言:</td>
					<td>
						<input id="language" name="language" type="text" placeholder="请输入官方语言" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.language}" />
					</td>
					<td>国家面积:</td>
					<td>
						<input id="acreage" name="acreage" type="text" placeholder="请输入国家面积" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.acreage}" />
					</td>
				</tr>
				<tr>
					<td>国际人口:</td>
					<td>
						<input id="population" name="population" type="text" placeholder="请输入国际人口" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.population}" />
					</td>
					<td>货币:</td>
					<td>
						<input id="currency" name="currency" type="text" placeholder="请输入货币" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.currency}" />
					</td>
				</tr>
				<tr>
					<td>时区:</td>
					<td>
						<input id="timezone" name="timezone" type="text" placeholder="请输入时区" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.timezone}" />
					</td>
					<td>宗教:</td>
					<td>
						<input id="religion" name="religion" type="text" placeholder="请输入宗教" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.religion}" />
					</td>
				</tr>
				<tr>
					<td>安全:</td>
					<td>
						<input id="security" name="security" type="text" placeholder="请输入安全" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.security}" />
					</td>
					<td>环境:</td>
					<td>
						<input id="ambient" name="ambient" type="text" placeholder="请输入环境" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.ambient}" />
					</td>
				</tr>
				<tr>
					<td>战乱:</td>
					<td>
						<input id="war" name="war" type="text" placeholder="请输入战乱" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.war}" />
					</td>
					<td>签证:</td>
					<td>
						<input id="visa" name="visa" type="text" placeholder="请输入签证" class=" easyui-textbox"  value="${countryDetails.visa}" />
					</td>
				</tr>
				<tr>
					<td>扩展阅读:</td>
					<td>
						<input id="extend" name="extend" type="text" placeholder="请输入扩展阅读" class=" easyui-textbox" data-options="required:true"  value="${countryDetails.extend}" />
					</td>
					<td>是否在前台展示：</td>
					<td>
						<select id="status" name="status" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
							<option value="1">展示</option>
							<option value="0">不展示</option>
						</select>
						<script type="text/javascript">
                            //下拉框赋值
                            $("#status").val('${country.status}');
						</script>
					</td>
				</tr>
				<input id="CDid" name="CDid" type="hidden" value="${countryDetails.id}" />
				<input id="countryId" name="countryId" type="hidden" value="${country.id}" />

			</table>
        </form>
    </div>
